<template>
  <page-body>
    <view class="page">
      <view class="flex benben-position-layout flex flex-wrap align-center chooseCur_flex_0"
        :style="{height:(88+StatusBarRpx)+'rpx',paddingTop:StatusBarRpx+'rpx', }">
        <view class='flex flex-wrap align-center justify-between flex-sub chooseCur_fd0_0'>
          <view class='flex flex-wrap align-center chooseCur_fd0_0_c0' @tap.stop="handleJumpDiy" data-type="back"
            data-url="1">
            <text class='fu-iconfont2  chooseCur_fd0_0_c0_c0'>&#xE794;</text>
          </view>
          <view class='flex flex-wrap align-stretch justify-center'>
            <text class='chooseCur_fd0_0_c1_c0'>客户</text>
          </view>
          <view class='flex flex-wrap align-center justify-end chooseCur_fd0_0_c0'>
          </view>
        </view>

      </view>
      <view :style="{height: (88+StatusBarRpx)+'rpx'}"></view>
      <!---flex布局flex布局开始-->
      <view class="flex flex-wrap align-center justify-between benben-flex-layout chooseCur_flex_1">
        <view class='flex flex-wrap align-center chooseCur_fd1_0'>
          <image class='chooseCur_fd1_0_c0' mode="aspectFit" :src='STATIC_URL+"150.png"'></image>
          <benben-input type="text" :placeholder="`输入客户姓名/联系电话`" confirm-type="done" :maxlength="-1"
            :adjust-position='true' placeholder-style="color:#999;font-size:28rpx" v-model="keywords"
            @confirm="getListFunc" />
        </view>
      </view>

      <!---flex布局flex布局结束-->
      <!---flex布局flex布局开始-->
      <template v-for='(item,flex2) in dataList'>
        <view class="flex flex-direction align-stretch benben-flex-layout chooseCur_flex_2" :key='flex2'>
          <view class='flex flex-wrap align-center justify-between chooseCur_fd2_0' @click.stop="chooseCur(item)">
            <image class='chooseCur_fd2_0_c0' mode="aspectFit" :src='STATIC_URL+"151.png"'></image>
            <view class='flex flex-direction align-stretch flex-sub chooseCur_fd2_0_c1'>
              <view class='flex flex-wrap align-center chooseCur_fd2_0_c1'>
                <text>{{item.customer_name}}</text>
                <!-- <image class='chooseCur_fd2_0_c1_c0_c1' mode="aspectFit" :src='STATIC_URL+"155.png"'></image> -->
              </view>
              <view class='flex flex-wrap align-center chooseCur_fd2_0_c1_c1'>
                <text>{{item.customer_phone}}</text>
              </view>
            </view>
            <image class='chooseCur_fd2_0_c2' mode="aspectFit" :src='STATIC_URL+"154.png"'></image>
          </view>
          <view class='flex flex-wrap align-end chooseCur_fd2_1'>
            <text class='chooseCur_fd2_1_c0'>{{item.customer_type_name}}日期：</text>
            <text>{{item.date_time}}</text>
          </view>
        </view>
      </template>
      <fu-empty :pagingListLoadedAll="pagingListLoadedAll" :pagingListNoListData="pagingListNoListData"
        :listDataLength="listDataLength" :isLoadInit="isLoadInit"></fu-empty>
      <!---flex布局flex布局结束-->
      <view class="flex benben-position-layout flex flex-wrap align-center chooseCur_flex_3">
        <button class='chooseCur_fd3_0' @tap.stop="handleJumpDiy" data-type="navigateTo"
          :data-url="`/pages/grzx/newCustomer/newCustomer`">新建客户</button>

      </view>
      <view :style="{height: '88rpx'}"></view>


    </view>
  </page-body>
</template>
<script>
  import pagingList from '@/common/mixin/paging_list.js';
  export default {
    components: {},
    mixins: [pagingList],

    data() {
      return {
        "minixPagingListsApi": "",
        "pageingListApiMethod": "",
        "allowOnloadGetList": false,
        "cateId": "1",
        "dataList": [],
        "keywords": "",
        "total": ""
      };
    },
    computed: {

    },
    watch: {},
    onLoad(options) {
      let {
        keywords,
        cid
      } = options
      if (keywords !== undefined) this.keywords = keywords
      if (cid !== undefined) this.cid = cid
      this.getData()

    },
    onUnload() {

    },
    onReady() {

    },
    onShow() {
      this.getListFunc()
    },
    onHide() {

    },
    onResize() {

    },
    onPullDownRefresh() {

    },
    onReachBottom(e) {

    },
    onPageScroll(e) {

    },
    methods: {
      getData() {
        this.$api.post(global.apiUrls.post666cefa6c20b2).then(res => {
          if (res.data.code == 1) {
            this.total = res.data.data.total
          }
        })
      },
      chooseCur(item) {
        uni.$emit('custoerm', item)
        uni.navigateBack()
      },
      getListFunc() {
        this.minixPagingListsApi = global.apiUrls.post666cefa6c20b2;
        this.pageingListApiMethod = 'post';
        this.allowOnloadGetList = false;
        this.pagingListPostDataContent = {
          keywords: this.keywords
        }
        this.listData = [];
        this.dataList = this.listData;
        this.pagingListToggle();

      },
      pagingListPostData() {
        return this.pagingListPostDataContent
      },
    }
  };
</script>
<style lang="scss" scoped>
  .page {
    width: 100vw;
    overflow-x: hidden;
    min-height: calc(100vh - var(--window-bottom));
    background: #F8F8F8;
    background-size: 100% auto;
  }

  .chooseCur_flex_0 {
    border-bottom: 1px solid #eee;
    background: #fff;
    width: 750rpx;
    height: 88rpx;
    overflow: hidden;
    z-index: 10;
    top: 0rpx;
    background-size: 100% auto !important;
  }

  .chooseCur_fd0_0_c1_c0 {
    font-size: 36rpx;
    font-weight: 700;
    color: #333333;
    line-height: 50rpx;
  }

  .chooseCur_fd0_0_c0_c0 {
    font-size: 36rpx;
    color: #333;
  }

  .chooseCur_fd0_0_c0 {
    width: 120rpx;
  }

  .chooseCur_fd0_0 {
    padding: 0rpx 32rpx 0rpx 32rpx;
  }

  .chooseCur_flex_1 {
    background: var(--benbenbgColor1);
    padding: 24rpx;
    background-size: 100% auto;
  }

  .chooseCur_fd1_0_c0 {
    width: 24rpx;
    height: 24rpx;
    margin: 0rpx 16rpx 0rpx 0rpx;
  }

  .chooseCur_fd1_0 {
    background: #F8F8F8;
    border-radius: 34rpx;
    width: 686rpx;
    height: 64rpx;
    line-height: 64rpx;
    padding: 0rpx 24rpx 0rpx 24rpx;
  }

  .chooseCur_flex_2 {
    background: rgba(255, 255, 255, 1);
    margin: 26rpx 24rpx 0rpx 24rpx;
    padding: 24rpx 24rpx 0rpx 24rpx;
    border-radius: 26rpx;
    background-size: 100% auto;
  }

  .chooseCur_fd2_1_c0 {
    color: rgba(170, 170, 170, 1);
  }

  .chooseCur_fd2_1 {
    padding: 24rpx 0rpx 24rpx 0rpx;
    font-size: 32rpx;
  }

  .chooseCur_fd2_0_c2 {
    width: 33rpx;
    height: 33rpx;
  }

  .chooseCur_fd2_0_c1_c1 {
    margin: 16rpx 0rpx 0rpx 0rpx;
  }

  .chooseCur_fd2_0_c1_c0_c1 {
    width: 115rpx;
    height: 34rpx;
    margin: 0rpx 0rpx 0rpx 16rpx;
  }

  .chooseCur_fd2_0_c1 {
    font-size: 32rpx;
    font-weight: 600;
  }

  .chooseCur_fd2_0_c0 {
    width: 62rpx;
    height: 67rpx;
    margin: 0rpx 24rpx 0rpx 0rpx;
  }

  .chooseCur_fd2_0 {
    border-bottom: 1px solid #eee;
    padding: 0rpx 0rpx 24rpx 0rpx;
  }

  .chooseCur_flex_3 {
    width: 686rpx;
    height: 88rpx;
    overflow: hidden;
    z-index: 10;
    bottom: calc(40rpx + var(--window-bottom));
    left: 32rpx;
  }

  .chooseCur_fd3_0 {
    background: #F9E4C3;
    border-radius: 44rpx 44rpx 44rpx 44rpx;
    width: 686rpx;
    line-height: 88rpx;
    font-size: 28rpx;
    color: var(--benbenFontColor0);
    height: 88rpx;
  }
</style>
